/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import React, { useState } from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Tabs } from 'antd';
import ImportCov from './components/ImportCov';
import CovRecords from './components/CovRecords';
import styles from './index.less';

const { TabPane } = Tabs;

function Cov19() {
  const [activeKey, setActiveKey] = useState<'imp' | 'records' | string>('imp');

  const handleTabChange = (active: 'imp' | 'records' | string) => {
    setActiveKey(active);
  };

  return (
    <PageContainer title='疫情数据上传' className={styles.main}>
      <Tabs type='card' onChange={handleTabChange}>
        <TabPane tab='疫情数据上传' key='imp'>
          <ImportCov current={activeKey} />
        </TabPane>
        <TabPane tab='上传记录' key='records'>
          <CovRecords current={activeKey} />
        </TabPane>
      </Tabs>
    </PageContainer>
  );
}

export default Cov19;
